<?php
	include_once 'isLogin.php';
	$groupc=new group(); //服务类

	$table="admin_topic";			//服务

	//删除
	if($_GET['action']=='del'){
		echo $commonc->del($table,$_POST['id']);
		exit();
	}

	//搜索
	if($_POST){
		$where=" AND a.topic like '%".$_POST['title']."%'";
		$smarty->assign('search',$_POST);
	}

	//列表
	$where.=' AND a.info_id=0';
	$row=$groupc->topic_list($where);
	$page=$row['page'];
	$row=$row['result'];


	for ($i=0; $i <count($row) ; $i++) { 
		$row[$i]['create_time']=date('Y-m-d H:i:s',$row[$i]['create_time']);
	}

	$smarty->assign("row",$row);
	$smarty->assign('page',$page);
	
	$smarty->display("admin_topic_list.html");
?>